package com.zigong.app.beans;

import android.support.annotation.NonNull;
import android.text.TextUtils;

import com.ruihang.generalibrary.ui.util.IListData;
import com.ruihang.generalibrary.utils.IDataDate;
import com.zigong.app.ui.util.IListShowData;

import org.xutils.db.annotation.Table;

import java.io.Serializable;
import java.sql.Date;
import java.util.ArrayList;

/**
 * Created by Administrator on 2017/8/10 0010.
 */
@Table(name = "ADynamicsItem")
public class ADynamicsItem implements IListShowData, Serializable, IDataDate {
    private static final long serialVersionUID = 8530436243369136292L;
    protected String anchorId;
    protected String dynamicId;
    protected String anchorAvatar;
    protected String anchorInfoUrl;
    protected String anchorName;
    protected String contentText;
    protected String contentVideo;
    protected String coverImage;
    protected String pubTime;

    private int attitudesCount;//	点赞数	number
    private boolean attitudesStatus;
    private ContentComment contentComment;
    private ArrayList<ContentImage> contentImage;
    private CoverImage videoImage;//	视频封面图	object
    private String userId;//



    protected int viewType;
    protected int currentPos;
    protected Date pubTimeTemp;
    protected boolean isLastItem;

    protected boolean isShrink;

    protected int playedPos;

    //是否标题
    protected boolean isSticky;
    //是否动态
    protected boolean isDynamics;

    protected boolean isMore;
    protected boolean isJump;

    protected String title;

    @Override
    public String getDataTitle() {
        return anchorName;
    }

    @Override
    public String getDataImg() {
        return anchorAvatar;
    }

    @Override
    public String getDataTag() {
        return contentText;
    }

    @Override
    public String getDataId() {
        return dynamicId;
    }

    @Override
    public int getDataType() {
        return 0;
    }

    @Override
    public int getDataViewType() {
        return viewType;
    }

    @Override
    public IListData getOwner() {
        return null;
    }

    @Override
    public String getTime() {
        return pubTime;
    }


    @Override
    public IListShowData getOwenerData() {
        return null;
    }

    public String getAnchorAvatar() {
        return anchorAvatar;
    }

    public ADynamicsItem setAnchorAvatar(String anchorAvatar) {
        this.anchorAvatar = anchorAvatar;
        return this;
    }

    public String getAnchorInfoUrl() {
        return anchorInfoUrl;
    }

    public ADynamicsItem setAnchorInfoUrl(String anchorInfoUrl) {
        this.anchorInfoUrl = anchorInfoUrl;
        return this;
    }

    public String getAnchorName() {
        return anchorName;
    }

    public ADynamicsItem setAnchorName(String anchorName) {
        this.anchorName = anchorName;
        return this;
    }

    public ArrayList<ContentImage> getContentImage() {
        return contentImage;
    }

    public ADynamicsItem setContentImage(ArrayList<ContentImage> contentImage) {
        this.contentImage = contentImage;
        return this;
    }

    public String getContentText() {
        return contentText;
    }

    public ADynamicsItem setContentText(String contentText) {
        this.contentText = contentText;
        return this;
    }

    public String getContentVideo() {
        return contentVideo;
    }

    public ADynamicsItem setContentVideo(String contentVideo) {
        this.contentVideo = contentVideo;
        return this;
    }

    public String getDynamicId() {
        return dynamicId;
    }

    public ADynamicsItem setDynamicId(String dynamicId) {
        this.dynamicId = dynamicId;
        return this;
    }

    public String getPubTime() {
        return pubTime;
    }

    public void setPubTime(String pubTime) {
        if (!TextUtils.equals(pubTime, this.pubTime)) {
            pubTimeTemp = null;
        }
        this.pubTime = pubTime;
    }

    public int getViewType() {
        return viewType;
    }

    public ADynamicsItem setViewType(int viewType) {
        this.viewType = viewType;
        return this;
    }

    public String getCoverImage() {
        return coverImage;
    }

    public void setCoverImage(String coverImage) {
        this.coverImage = coverImage;
    }

    public int getCurrentPos() {
        return currentPos;
    }

    public void setCurrentPos(int currentPos) {
        this.currentPos = currentPos;
    }

    public String getAnchorId() {
        return anchorId;
    }

    public void setAnchorId(String anchorId) {
        this.anchorId = anchorId;
    }

    public boolean isLastItem() {
        return isLastItem;
    }

    public void setLastItem(boolean lastItem) {
        isLastItem = lastItem;
    }

    public boolean isShrink() {
        return isShrink;
    }

    public void setShrink(boolean shrink) {
        isShrink = shrink;
    }

    public int getPlayedPos() {
        return playedPos;
    }

    public void setPlayedPos(int playedPos) {
        this.playedPos = playedPos;
    }

    public boolean isSticky() {
        return isSticky;
    }

    public void setSticky(boolean sticky) {
        isSticky = sticky;
    }

    public boolean isDynamics() {
        return isDynamics;
    }

    public void setDynamics(boolean dynamics) {
        isDynamics = dynamics;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean isMore() {
        return isMore;
    }

    public void setMore(boolean more) {
        isMore = more;
    }

    public boolean isJump() {
        return isJump;
    }

    public void setJump(boolean jump) {
        isJump = jump;
    }

    public int getAttitudesCount() {
        return attitudesCount;
    }

    public void setAttitudesCount(int attitudesCount) {
        this.attitudesCount = attitudesCount;
    }

    public boolean getAttitudesStatus() {
        return attitudesStatus;
    }

    public void setAttitudesStatus(boolean attitudesStatus) {
        this.attitudesStatus = attitudesStatus;
    }

    public ContentComment getContentComment() {
        return contentComment;
    }

    public void setContentComment(ContentComment contentComment) {
        this.contentComment = contentComment;
    }

    public CoverImage getVideoImage() {
        return videoImage;
    }

    public void setVideoImage(CoverImage videoImage) {
        this.videoImage = videoImage;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "ADynamicsItem{" +
                "dynamicId='" + dynamicId + '\'' +
                ", anchorId='" + anchorId + '\'' +
                ", anchorAvatar='" + anchorAvatar + '\'' +
                ", anchorInfoUrl='" + anchorInfoUrl + '\'' +
                ", anchorName='" + anchorName + '\'' +
                ", contentImage=" + contentImage +
                ", contentText='" + contentText + '\'' +
                ", contentVideo='" + contentVideo + '\'' +
                ", coverImage='" + coverImage + '\'' +
                ", pubTime='" + pubTime + '\'' +
                ", viewType=" + viewType +
                ", currentPos=" + currentPos +
                ", playedPos=" + playedPos +
                '}';
    }

    @Override
    public Date getDataDate() {
        return pubTimeTemp;
    }

    @Override
    public void setDataDate(Date date) {
        pubTimeTemp = date;
    }

    @NonNull
    @Override
    public String getDatePattern() {
        return "yyyy-MM-dd HH:mm:ss";
    }

    @Override
    public String getDateString() {
        return pubTime;
    }
}
